(a). Field of the Invention
This invention relates to a network device, and more particularly, to bandwidth control of the network device.
(b). Description of the Prior Arts
In network bandwidth control techniques, the leaky bucket or token bucket is commonly used to shape irregular network traffic into a constant transmission rate. FIG. 1 is a schematic diagram illustrating the operation of a bandwidth control device using the leaky bucket. The leaky bucket 11 contains tokens where each token corresponds to a transmittable data size. The packets waiting in the packet queue 12 will be transmitted orderly after receiving the tokens. Thus the rate of data transmission can be adjusted by controlling the rate of refilling tokens in the leaky bucket 11, thereby controlling the bandwidth. Therefore, the leaky bucket 11 has a control parameter R in the unit of bps (bits per second) to define the token refill rate, which also represents the data transmission rate (i.e. bandwidth). The leaky bucket 11 is also set up with a burst size, which represents the maximum number of tokens it can hold. When the number of tokens accumulated in the leaky bucket 11 exceeds this burst size, subsequently refilled tokens will be discarded. In conventional schemes, tokens are refilled over a time interval. For example, if the token data size is 640 bits and time interval is 10 ms, then bandwidth R equals to 64 Kbps.
FIG. 2 is a diagram showing a conventional bandwidth control circuit, in which the value of register 21 represents the token data size, while the value of register 22 (i.e. leaky bucket) indicates the transmittable data size, which decreases as data are sent. Multiplexer 23 works according to the output of NOR gate 24. Counter 25 is used to control the duration of time interval. As shown in FIG. 2, in each time interval, multiplexer 23 will add tokens once to register 22.
However, conventional bandwidth control schemes run into the problem of unstable bandwidth. When the duration of time interval is set longer, the token data size to be refilled each time becomes bigger. If there are multiple packets to be sent, they might be sent all at once, which leads to rate burst and results in less stable bandwidth.
In the example of using register T (e.g. register 21 in FIG. 2) for storing token data size, and register I for storing time interval (in FIG. 2, counter 25 controls time interval based on the setting of register I), assuming register T and register I each has 4 bits, the token data size and time interval (in unit of bits and seconds respectively) can be any number from 1, 2, . . . , 15. FIG. 3 shows the number of bandwidths that can be generated when register T and register I each has 4 bits, in which, x axis represents bandwidth (in bps), y axis represents the number of bandwidths that can be generated by all combinations of register T value and register I value. As shown, bandwidths that can be expressed by the combinations of register T and register I concentrate in lower value section (under 5). Thus conventional bandwidth control is unable to achieve more subtle performance in higher bandwidth section, which means less flexibility in bandwidth control.